/** @Date 下午4:56:25
  * @version 1.0.0
  * @author shangyd
  * Copyright (c) 2015
  */
package com.sdw.soft.activemq.demo;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sdw.soft.activemq.vo.Notify;

public class DemoMessageListener implements MessageListener{

	private static final Logger logger = LoggerFactory.getLogger(DemoMessageListener.class);
	@Override
	public void onMessage(Message message) {
		logger.info("consumer start to comsume ... ...");
		ObjectMessage objectMessage = (ObjectMessage)message;
		Notify notify;
		try {
			notify = (Notify)objectMessage.getObject();
			logger.info("consume title="+notify.getTitle()+",content="+notify.getContent());
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

}
